'use client';

import { ReactNode } from 'react';
import { SessionProvider } from 'next-auth/react';
import { SocketProvider } from '@/hooks/use-socket';

interface ProvidersProps {
  children: ReactNode;
}

/**
 * 全局提供者组件，用于包装应用并提供全局功能
 */
export function Providers({ children }: ProvidersProps) {
  return (
    <SessionProvider>
      <SocketProvider url={process.env.NEXT_PUBLIC_SOCKET_URL || '/api/socket'}>
        {children}
      </SocketProvider>
    </SessionProvider>
  );
} 